package com.example.mybatisplus.model.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 这是用户账户表
 * </p>
 *
 * @author cft
 * @since 2022-06-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pcs_user_account")
@ApiModel(value="UserAccount对象", description="这是用户账户表")
public class UserAccount extends Model<UserAccount> {

    private static final long serialVersionUID = 1L;

    @TableId("user_id")
    private Long userId;

    private String name;

    private String password;

    private String userType;

    private String userDescription;

	private String userContact;

	@TableLogic(value = "0", delval = "-1")
	private Integer is_deleted;
	
    @Override
	protected Serializable pkVal() {
		return this.userId;
	}
	
	public static Long typeTraverse(String str) {
		Long result=0L;
		switch (str) {
			case "中心管理员":
				result = 1L;
				break;
			case "初访员":
				result = 2L;
				break;
			case "咨询助理":
				result = 3L;
				break;
			case "咨询师":
				result = 4L;
				break;
			case "学生":
				result = 5L;
				break;
		}
		return result;
	}

}
